package com.ysd.ziyuanshiyongtongji.task;

import javax.annotation.Resource;

import com.ysd.ziyuanshiyongtongji.dao.IStatisticsDao;

import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@EnableScheduling//启用定时任务
public class StatisticsTask {

    @Resource
    private IStatisticsDao statisticsDao;

    @Scheduled(cron = "0 0 0 */1 * ?")//每天0点执行一次
    public void autoStatistics(){
        statisticsDao.autoStatistics();
    }
}